﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="Members.aspx.vb" Inherits="LondonItalianRestaurants.Members" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h1>Members</h1> <div style="float:right;width="10em"">
    <asp:DetailsView ID="DetailsView1" 
        runat="server" AutoGenerateRows="False" 
        CellPadding="4" DataKeyNames="Dinerid" DataSourceID="SqlDataSource2" 
        ForeColor="#333333" Height="50px" Width="22%">
        <AlternatingRowStyle BackColor="White" />
        <CommandRowStyle BackColor="#D1DDF1" Font-Bold="True" />
        <EditRowStyle BackColor="#2461BF" />
        <FieldHeaderStyle BackColor="#DEE8F5" Font-Bold="True" />
        <Fields>
            <asp:BoundField DataField="Dinerid" HeaderText="User Name" ReadOnly="True" 
                SortExpression="Dinerid" />
            <asp:BoundField DataField="FirstName" HeaderText="FirstName" 
                SortExpression="FirstName" />
            <asp:BoundField DataField="LastName" HeaderText="LastName" 
                SortExpression="LastName" />
            <asp:BoundField DataField="DateOfBirth" HeaderText="DateOfBirth" 
                SortExpression="DateOfBirth" />
            <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
            <asp:BoundField DataField="Gender" HeaderText="Gender" 
                SortExpression="Gender" />
            <asp:ImageField DataImageUrlField="Portrait" HeaderText="Portrait" 
                SortExpression="Portrait">
                <ControlStyle Height="100px" Width="100px" />
            </asp:ImageField>
        </Fields>
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
    </asp:DetailsView></div>
<br />
    <div style="overflow:scroll; width: 481px;" float="left";><asp:ListView ID="ListView1" runat="server" DataKeyNames="Dinerid" 
        DataSourceID="SqlDataSource1" GroupItemCount="4" border="fixed">
        <AlternatingItemTemplate>
            <td id="Td1" runat="server" style="background-color:yellow;color: #333333;">
                
               
                
               
                <a href='Members.aspx?DinerId=<%# Eval("Dinerid") %>'><img src='<%# Eval("Portrait") %>' style="width:100px;height:100px" /> <br /><asp:Label ID="FirstNameLabel" runat="server" Text='<%# Eval("FirstName") %>' /> 
               
            </td>
        </AlternatingItemTemplate>
        <EditItemTemplate>
            <td runat="server" style="background-color: #FFCC66;color: #000080;">
                FirstName:
                <asp:TextBox ID="FirstNameTextBox" runat="server" 
                    Text='<%# Bind("FirstName") %>' />
                <br />LastName:
                <asp:TextBox ID="LastNameTextBox" runat="server" 
                    Text='<%# Bind("LastName") %>' />
                <br />Portrait:
                <asp:TextBox ID="PortraitTextBox" runat="server" 
                    Text='<%# Bind("Portrait") %>' />
                <br />DateOfBirth:
                <asp:TextBox ID="DateOfBirthTextBox" runat="server" 
                    Text='<%# Bind("DateOfBirth") %>' />
                <br />Email:
                <asp:TextBox ID="EmailTextBox" runat="server" Text='<%# Bind("Email") %>' />
                <br />Address:
                <asp:TextBox ID="AddressTextBox" runat="server" Text='<%# Bind("Address") %>' />
                <br />Telephone:
                <asp:TextBox ID="TelephoneTextBox" runat="server" 
                    Text='<%# Bind("Telephone") %>' />
                <br />Gender:
                <asp:TextBox ID="GenderTextBox" runat="server" Text='<%# Bind("Gender") %>' />
                <br />Dinerid:
                <asp:Label ID="DineridLabel1" runat="server" Text='<%# Eval("Dinerid") %>' />
                <br />
                <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                    Text="Update" />
                <br />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Cancel" />
                <br />
            </td>
        </EditItemTemplate>
        <EmptyDataTemplate>
            <table runat="server" 
                style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
                <tr>
                    <td>
                        No data was returned.</td>
                </tr>
            </table>
        </EmptyDataTemplate>
        <EmptyItemTemplate>
<td runat="server" />
        </EmptyItemTemplate>
        <GroupTemplate>
            <tr ID="itemPlaceholderContainer" runat="server">
                <td ID="itemPlaceholder" runat="server">
                </td>
            </tr>
        </GroupTemplate>
        <InsertItemTemplate>
            <td runat="server" style="">
                FirstName:
                <asp:TextBox ID="FirstNameTextBox" runat="server" 
                    Text='<%# Bind("FirstName") %>' />
                <br />LastName:
                <asp:TextBox ID="LastNameTextBox" runat="server" 
                    Text='<%# Bind("LastName") %>' />
                <br />Portrait:
                <asp:TextBox ID="PortraitTextBox" runat="server" 
                    Text='<%# Bind("Portrait") %>' />
                <br />DateOfBirth:
                <asp:TextBox ID="DateOfBirthTextBox" runat="server" 
                    Text='<%# Bind("DateOfBirth") %>' />
                <br />Email:
                <asp:TextBox ID="EmailTextBox" runat="server" Text='<%# Bind("Email") %>' />
                <br />Address:
                <asp:TextBox ID="AddressTextBox" runat="server" Text='<%# Bind("Address") %>' />
                <br />Telephone:
                <asp:TextBox ID="TelephoneTextBox" runat="server" 
                    Text='<%# Bind("Telephone") %>' />
                <br />Gender:
                <asp:TextBox ID="GenderTextBox" runat="server" Text='<%# Bind("Gender") %>' />
                <br />Dinerid:
                <asp:TextBox ID="DineridTextBox" runat="server" Text='<%# Bind("Dinerid") %>' />
                <br />
                <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                    Text="Insert" />
                <br />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Clear" />
                <br />
            </td>
        </InsertItemTemplate>
        <ItemTemplate>
            <td runat="server" style="background-color:silver;color: #333333;">
                
                 
               
                <a href='Members.aspx?DinerId=<%# Eval("Dinerid") %>'><img src='<%# Eval("Portrait") %>' style="width:100px;height:100px" /><br /><asp:Label ID="FirstNameLabel" runat="server" Text='<%# Eval("FirstName") %>' />
               
            </td>
        </ItemTemplate>
        <LayoutTemplate>
            <table runat="server">
                <tr runat="server">
                    <td runat="server">
                        <table ID="groupPlaceholderContainer" runat="server" border="1" 
                            style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
                            <tr ID="groupPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr runat="server">
                    <td runat="server" 
                        style="text-align: center;background-color: #FFCC66;font-family: Verdana, Arial, Helvetica, sans-serif;color: #333333;">
                       
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
        <SelectedItemTemplate>
            <td runat="server" 
                style="background-color: #FFCC66;font-weight: bold;color: #000080;">
                FirstName:
                <asp:Label ID="FirstNameLabel" runat="server" Text='<%# Eval("FirstName") %>' />
                <br />LastName:
                <asp:Label ID="LastNameLabel" runat="server" Text='<%# Eval("LastName") %>' />
                <br />Portrait:
                <asp:Label ID="PortraitLabel" runat="server" Text='<%# Eval("Portrait") %>' />
                <br />DateOfBirth:
                <asp:Label ID="DateOfBirthLabel" runat="server" 
                    Text='<%# Eval("DateOfBirth") %>' />
                <br />Email:
                <asp:Label ID="EmailLabel" runat="server" Text='<%# Eval("Email") %>' />
                <br />Address:
                <asp:Label ID="AddressLabel" runat="server" Text='<%# Eval("Address") %>' />
                <br />Telephone:
                <asp:Label ID="TelephoneLabel" runat="server" Text='<%# Eval("Telephone") %>' />
                <br />Gender:
                <asp:Label ID="GenderLabel" runat="server" Text='<%# Eval("Gender") %>' />
                <br />Dinerid:
                <asp:Label ID="DineridLabel" runat="server" Text='<%# Eval("Dinerid") %>' />
                <br />
            </td>
        </SelectedItemTemplate>
    </asp:ListView></div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        SelectCommand="SELECT [FirstName], [LastName], [Portrait], [DateOfBirth], [Email], [Address], [Telephone], [Gender], [Dinerid] FROM [UserProfile]">
    </asp:SqlDataSource>
    <br />
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        SelectCommand="SELECT [Dinerid], [FirstName], [LastName], [Portrait], [DateOfBirth], [Email], [Gender] FROM [UserProfile] WHERE ([Dinerid] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="Dinerid" QueryStringField="Dinerid" 
                Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    </asp:Content>
